<template>
	<div style="padding:0px;">
		<el-form :model="dialogForm"  ref="dialogForm" :rules="rules" :label-width="formLabelWidth">
			<el-tabs v-model="activeName" type="card" >
				<el-tab-pane label="图片信息" name="1">
			    	<el-form-item label="上游购销合同" >
				      	<qiniu  :qiniuImage="qiniuImage1"  :packJson="packJson" :id="qiniuImage1.id" :canDelete="false"></qiniu>
				    </el-form-item>
				    <el-form-item label="定金凭证" >
				      <qiniu  :qiniuImage="qiniuImage2"  :packJson="packJson" :id="qiniuImage2.id" :canDelete="false"></qiniu>
				    </el-form-item>
				    <el-form-item label="供应商收款账号" >
				      <qiniu  :qiniuImage="qiniuImage3"  :packJson="packJson" :id="qiniuImage3.id" :canDelete="false"></qiniu>
				    </el-form-item>
				    <el-form-item label="提车地址及联系人" >
				      <qiniu  :qiniuImage="qiniuImage4"  :packJson="packJson" :id="qiniuImage4.id" :canDelete="false"></qiniu>
				    </el-form-item>
				    <el-form-item label="补充图片" >
				      <qiniu  :qiniuImage="qiniuImage5"  :packJson="packJson" :id="qiniuImage5.id" :canDelete="false"></qiniu>
				    </el-form-item>
			    </el-tab-pane>

			    <el-tab-pane label="基本信息" name="2">
			    	<el-form-item label="订单号"   class="half">
				      <el-input  v-model="dialogFormInfo.orderInfo.orderNumber" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="申请时间"  class="half">
				      <el-input  v-model="dialogFormInfo.orderInfo.addTime" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="订单类型"  class="half">
				      <el-input  v-model="dialogFormInfo.orderInfo.typeCH" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="业务员"  class="half">
				      <el-input  v-model="dialogFormInfo.orderInfo.yewuUser" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    
				    <el-form-item label="订单状态"  class="half">
				      <el-input  v-model="dialogFormInfo.orderInfo.orderStatusVO" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="经销商名称"  >
				      <el-input  v-model="dialogFormInfo.orderInfo.dealerInfoVO.name" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="汽车车型" >
				      <el-input  v-model="dialogFormInfo.orderInfo.carBrandName" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    
				    <el-form-item label="汽车数量"  class="half">
				      <el-input  v-model="dialogFormInfo.orderInfo.amount" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="汽车颜色"  class="half">
				      <el-input  v-model="dialogFormInfo.orderInfo.color" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    
				    <el-form-item label="购车总价格"  class="currency">
				      <el-input  :value="dialogFormInfo.orderInfo.totalPrice |toFixed2" auto-complete="off" disabled ></el-input>
				      <span class="convertCurrency">{{dialogFormInfo.orderInfo.totalPrice|convertCurrency}}</span>
				    </el-form-item>
				    <el-form-item label="定金金额"  class="currency">
				      <el-input  :value="dialogFormInfo.orderInfo.earnest |toFixed2" auto-complete="off" disabled ></el-input>
				      <span class="convertCurrency">{{dialogFormInfo.orderInfo.earnest|convertCurrency}}</span>
				    </el-form-item>
				    <el-form-item label="垫资金额"  class="currency">
				      <el-input  :value="dialogFormInfo.orderInfo.paymentAmount |toFixed2" auto-complete="off" disabled ></el-input>
				      <span class="convertCurrency">{{dialogFormInfo.orderInfo.paymentAmount|convertCurrency}}</span>
				    </el-form-item>
				    <el-form-item label="保证金金额"  class="currency">
				      <el-input  :value="dialogFormInfo.orderInfo.deposit |toFixed2" auto-complete="off" disabled ></el-input>
				      <span class="convertCurrency">{{dialogFormInfo.orderInfo.deposit|convertCurrency}}</span>
				    </el-form-item>
				    <el-form-item label="垫资比例"  class="half">
				      <el-input  :value="(((dialogFormInfo.orderInfo.paymentAmount-0)/(dialogFormInfo.orderInfo.totalPrice-0)*100-0).toFixed(2)||'')+'%'" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="当前利率"  class="half">
				      <el-input  :value="(dialogFormInfo.orderInfo.interestRate-0).toFixed(4)" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="借款时长"  class="half">
				      <el-input  v-model="dialogFormInfo.orderInfo.description" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="地推员"  class="half">
				      <el-input  v-model="dialogFormInfo.orderInfo.dituiUser" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="指导价/配置" >
				      <el-input  type="textarea" :rows=3 v-model="dialogFormInfo.orderInfo.carConfig" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="价格审核备注" >
				      <el-input  type="textarea" :rows=3 v-model="dialogFormInfo.orderInfo.priceRemark" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="补充说明" >
				      <el-input  type="textarea" :rows=3 v-model="dialogFormInfo.orderInfo.supplementExplain" auto-complete="off" disabled ></el-input>
				    </el-form-item>

			    </el-tab-pane>
			    <el-tab-pane label="上游供应商信息" name="3">
			    	<el-form-item label="合同上游名称" >
				      <el-input  v-model="dialogFormInfo.orderInfo.supplierName" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				  	
				    <el-form-item label="提车详细地址" >
				      <el-input  v-model="dialogFormInfo.orderInfo.supplierAddress" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				  	<el-form-item label="提车联系人" >
				      <el-input  v-model="dialogFormInfo.orderInfo.supplierPerson" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="联系人手机号" >
				      <el-input  v-model="dialogFormInfo.orderInfo.supplierPhone" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="收款帐户名1" >
				      <el-input  v-model="dialogFormInfo.orderInfo.accountName" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="开户行名称1" >
				      <el-input  v-model="dialogFormInfo.orderInfo.openningBank" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				  	<el-form-item label="收款账号1" >
				      <el-input  v-model="dialogFormInfo.orderInfo.accountNumber" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    
				    <el-form-item label="收款帐户名2" >
				      <el-input  v-model="dialogFormInfo.orderInfo.accountNameBak" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="开户行名称2" >
				      <el-input  v-model="dialogFormInfo.orderInfo.openningBankBak" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="收款账号2" >
				      <el-input  v-model="dialogFormInfo.orderInfo.accountNumberBak" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    
				  	<el-form-item label="打款备注" >
				      <el-input type="textarea" :rows=3 v-model="dialogFormInfo.orderInfo.remark" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    
			    </el-tab-pane>
			    <el-tab-pane label="初审结果" name="4">
			    	<el-form-item label="上游购销合同审核结果" >
				      <el-input  v-model="dialogFormInfo.orderInfo.orderAuditResults.upperReacherExamineResult" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="定金凭证审核结果" >
				      <el-input  v-model="dialogFormInfo.orderInfo.orderAuditResults.earnestExamineResult" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="供应商名称" >
				      <el-input  v-model="dialogFormInfo.orderInfo.orderAuditResults.supplierEstablishName" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="供应商成立日期" >
				      <el-input  :value="dialogFormInfo.orderInfo.orderAuditResults.supplierEstablishTime |parseTime('{y}-{m}-{d}')" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="供应商审核结果" >
				      <el-input  v-model="dialogFormInfo.orderInfo.orderAuditResults.establishExamineResult" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="供应商资质图片" >
				      <qiniu  :qiniuImage="qiniuImage6"  :packJson="packJson" :id="qiniuImage6.id" :canDelete="false"></qiniu>
				    </el-form-item>
				    <el-form-item label="资源商名称" >
				      <el-input  v-model="dialogFormInfo.orderInfo.orderAuditResults.resourceProviderName" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="资源商成立日期" >
				      <el-input  :value="dialogFormInfo.orderInfo.orderAuditResults.resourceProviderEstablishTime |parseTime('{y}-{m}-{d}') " auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="资源商审核结果" >
				      <el-input  v-model="dialogFormInfo.orderInfo.orderAuditResults.resourceProviderExamineResult" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="资源商资质图片" >
				      <qiniu  :qiniuImage="qiniuImage7"  :packJson="packJson" :id="qiniuImage7.id" :canDelete="false"></qiniu>
				    </el-form-item>
				    <el-form-item label="提车地址审核结果" >
				      <el-input  v-model="dialogFormInfo.orderInfo.orderAuditResults.carAddressExamineResult" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="资料更改记录" >
				      <el-input type="textarea" :rows=3 v-model="dialogFormInfo.orderInfo.dataChangeRecord" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="审核人员" >
				      <el-input  v-model="dialogFormInfo.orderInfo.orderAuditResults.firstExamineResultName" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="审核时间" >
				      <el-input  v-model="dialogFormInfo.orderInfo.orderAuditResults.firstExamineResultTime" auto-complete="off" disabled ></el-input>
				    </el-form-item>

			    </el-tab-pane>
			    <el-tab-pane label="二审信息及合同" name="5">
			    	<h3>二审信息</h3>
			    <!-- 	<el-form-item label="车辆资料相关证明(打款证明)" >
				      <el-input  v-model="dialogForm.qczjg" auto-complete="off" disabled ></el-input>
				    </el-form-item> -->
				    <el-form-item label="车辆资料相关证明(打款证明)" >
				      <qiniu  :qiniuImage="qiniuImage8"  :packJson="packJson" :id="qiniuImage8.id" :canDelete="false"></qiniu>
				    </el-form-item>
				    <el-form-item label="车辆相关信息审核结果" >
				      <el-input  v-model="dialogFormInfo.orderInfo.orderAuditResults.carInformationExamineResult" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="预计手续寄送日期" >
				      <el-input  :value="dialogFormInfo.orderInfo.orderAuditResults.proceduresSendTime | parseTime('{y}-{m}-{d}')" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="物钥匙数量" >
				      <el-input  v-model="dialogFormInfo.orderInfo.orderAuditResults.keyCount" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="具体钥匙情况" >
				      <el-input  v-model="dialogFormInfo.orderInfo.orderAuditResults.keySituation" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="二审结果" >
				      <el-input  v-model="dialogFormInfo.orderInfo.secondReviewRemark" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="审核人员" >
				      <el-input  v-model="dialogFormInfo.orderInfo.orderAuditResults.secondExamineResultName" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="审核时间" >
				      <el-input  v-model="dialogFormInfo.orderInfo.orderAuditResults.secondExamineResultTime" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <h3>资金方及合同信息</h3>

				    <el-form-item label="资金方"  > 
				    	<el-select 
		                    	v-model.number="dialogFormInfo.orderInfo.funderId" 
		                    	placeholder="请选择资金方"  
		                    	:disabled="this.dialogFormInfo.isCreateContract"
		                    	v-on:change="getSpvUser()"     
		                    	>
		                <el-option  label="请选择资金方" value="0" >
                        </el-option> 	
					       <el-option    
                                v-for="(item,index) in dialogFormInfo.funderUser"  
                                :label="item.realname"  
                                :value="item.id"   
                                :key="index"
                                >  
	                       </el-option>  
					    </el-select>    
				    </el-form-item>

				       <el-form-item label="SPV"  >  
				    	<el-select 
		                    	v-model.number="dialogFormInfo.orderInfo.spvId" 
		                    	placeholder="请选择SPV"  
		                    	:disabled="this.dialogFormInfo.isCreateContract"   
		                    	>      
					       <el-option     
                                :label="selectSpvUser.realname"  
                                :value="selectSpvUser.id"   
                                >  
	                       </el-option>   
					    </el-select>     
				    </el-form-item>



				    <el-form-item v-if="isAdd.bool" label="合同信息" >
				      <el-transfer v-model="contractValue" :data="contractData" :titles="contractTitles" @change="contractChange"></el-transfer>
				    </el-form-item>
				    <el-form-item v-if="!isAdd.bool" label="合同信息列表" >
				      {{'这里是显示已选择的合同列表'}}---
				    </el-form-item>
			    </el-tab-pane>
			    <el-tab-pane label="物流验车" name="6">
				    <h3>物流信息</h3>
				    <el-form-item  label="物流公司" >
				      <el-input  v-model="dialogFormInfo.orderInfo.logisticsCompany.name" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="验车司机信息" >
				      <el-input  type="textarea" :rows=3 v-model="dialogFormInfo.orderInfo.logisticsInfo.driverInfo" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				  	<el-form-item label="运输目的地"  >

				      <el-input  :value="(dialogFormInfo.orderInfo.logisticsInfo.province||'') +(dialogFormInfo.orderInfo.logisticsInfo.city||'')+(dialogFormInfo.orderInfo.logisticsInfo.county||'')+(dialogFormInfo.orderInfo.logisticsInfo.destination||'')" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="物流费"  class="currency">
				      <el-input  :value="dialogFormInfo.orderInfo.logisticsInfo.logisticsFee |toFixed2" auto-complete="off" disabled ></el-input>
				      <span class="convertCurrency">{{dialogFormInfo.orderInfo.logisticsInfo.logisticsFee|convertCurrency}}</span>
				    </el-form-item>
				    <el-form-item label="放空费"  class="currency">
				      <el-input  :value="dialogFormInfo.orderInfo.logisticsInfo.basicFee |toFixed2" auto-complete="off" disabled ></el-input>
				      <span class="convertCurrency">{{dialogFormInfo.orderInfo.logisticsInfo.basicFee|convertCurrency}}</span>
				    </el-form-item>
				<!--     <el-form-item label="放空费用"  >
				      <el-input  v-model="dialogForm.qczjg" auto-complete="off" disabled ></el-input>
				    </el-form-item> -->
				    <el-form-item label="预计验车时间"  >
				      <el-input  v-model="dialogFormInfo.orderInfo.logisticsInfo.estimatedInspectTime" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="预计运输时间"  >
				      <el-input  v-model="dialogFormInfo.orderInfo.logisticsInfo.estimeatedDays" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="公里数"  >
				      <el-input  v-model="dialogFormInfo.orderInfo.logisticsInfo.mileage" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <h3>物流确认</h3>
				    <el-form-item label="车辆基本信息是否确认"  >
				       <el-radio-group v-model.number="dialogFormInfo.orderInfo.logisticsInfo.status" disabled >
					      <el-radio :label="3" >审核通过</el-radio>
					      <el-radio :label="2"  >审核不通过</el-radio>
					   </el-radio-group>
				    </el-form-item>
				    <el-form-item label="审核备注"  >
				      <el-input  type="textarea" :rows=3 v-model="dialogFormInfo.orderInfo.logisticsInfo.comment" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <h3>验车信息</h3>
				    <el-form-item label="验车图片" >
				      <qiniu  :qiniuImage="qiniuImage9"  :packJson="packJson" :id="qiniuImage9.id" :canDelete="false"></qiniu>	
				    </el-form-item>
				    <el-form-item label="车架号"  >
				      <el-input  type="textarea" :rows=3 v-model="dialogFormInfo.orderInfo.carInspectionInfo.vin" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="生产年月"  >
				      <el-input  type="textarea" :rows=3 v-model="dialogFormInfo.orderInfo.carInspectionInfo.productionDate" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="备注信息"  >
				      <el-input  type="textarea" :rows=3 v-model="dialogFormInfo.orderInfo.carInspectionInfo.remark" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <h3>确认信息</h3>
				    <el-form-item label="确认信息"  >
				       <el-radio-group v-model.number="dialogFormInfo.orderInfo.carInspectionInfo.status" disabled>
					      <el-radio :label="3" >通过</el-radio>
					      <el-radio :label="2"  >不通过</el-radio>
					   </el-radio-group>
				    </el-form-item>
				    <el-form-item label="确认备注"  >
				      <el-input  type="textarea" :rows=3 v-model="dialogFormInfo.orderInfo.carInspectionInfo.confirmRemark" auto-complete="off" disabled ></el-input>
				    </el-form-item>
			    </el-tab-pane>
			    <el-tab-pane label="保证金" name="7">
			    	<el-form-item label="保证金金额"   class="currency">
				      <el-input  :value="dialogFormInfo.orderInfo.deposit |toFixed2" auto-complete="off" disabled ></el-input>
				      <span class="convertCurrency">{{dialogFormInfo.orderInfo.deposit|convertCurrency}}</span>
				    </el-form-item>
				    <el-form-item label="保证金凭证"  >
				      <qiniu  :qiniuImage="qiniuImage10"  :packJson="packJson" :id="qiniuImage10.id" :canDelete="false"></qiniu>
				    </el-form-item>
			    	<el-form-item label="审核信息"  >
				       <el-radio-group v-model.number="dialogFormInfo.orderInfo.cashDepositInfo.status" disabled>
					      <el-radio :label="3" >通过</el-radio>
					      <el-radio :label="2"  >不通过</el-radio>
					   </el-radio-group>
				    </el-form-item>
				    <el-form-item label="审核备注"  >
				      <el-input  type="textarea" :rows=3 v-model="dialogFormInfo.orderInfo.cashDepositInfo.reviewRemark" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="给资金方凭证"  >
				      <qiniu  :qiniuImage="qiniuImage11"  :packJson="packJson" :id="qiniuImage11.id" :canDelete="false"></qiniu>
				    </el-form-item>
			    </el-tab-pane>
			</el-tabs>
			<div style="text-align:right;margin-top:15px;">
				 <el-button @click="returnBack">返 回</el-button>
				 <el-button  v-if="isAdd.bool" type="primary" @click="submitConfirmForm('dialogForm')">提 交</el-button>
			</div>
		</el-form>
	</div>
</template>

<script  th:inline="javascript">
 /*<![CDATA[*/
    var test = 1;
    import router from '@/router';
    import qiniu from '@/views/qiniu/upload';
    import agentHttp from '@/utils/agentHttp.js';
	export default{
		created(){ 
			this.initDataInfo(); 
        },
		props:['dialogFormVisible','query','isAdd','dialogFormInfo'], 
		components:{qiniu}, 
		data(){
			// const generateData = _ => {
	  //           const data = [];
		 //        for ( let i = 1; i <= this.dialogFormInfo.contractList.length; i++ ) {
		 //          var contracinfo = this.dialogFormInfo.contractList[i];


		 //          data.push({
		 //            key: i,
		 //            label: `永利宝借款${ i }` ,
		           
		 //          });
		 //        }
		 //        return data;
		 //    };
			return{
				formLabelWidth:'170px',
				//弹窗或者查看页面信息
		        dialogForm:{ 
		          imagUrl:[],
				  imagUrl1:[],
				  imagUrl2:[],
				  imagUrl3:[],
				  imagUrl4:[],
				  imagUrl5:[] 
		        },
		        rules: {
		          name: [{ required: true, message: '请输入经销商名称', trigger: 'blur' }],
		          qckx:[{ required: true, message: '请输入提车地址(启运地)', trigger: 'blur' }]
		        },
		        dialogImageUrl:"",
		        dialogVisible:false,
		        activeShow:false,
		        activeName:"5",

		        contractData: [],
                contractValue: [],
                contractTitles:['可选合同模板','已选合同模板'],
                //七牛图片上传
                 qiniuImage:{
		        	id:"qiniuImage1", //图片预览的id   
		        	image_uri:[],    //图片上传的列表  只含有url地址
		        },
		        qiniuImage1:{
		        	id:"qiniuImage1", //图片预览的id   
		        	image_uri:[],    //图片上传的列表  只含有url地址
		        },
		        qiniuImage2:{
		        	id:"qiniuImage2", //图片预览的id   
		        	image_uri:[],    //图片上传的列表  只含有url地址
		        },
		        qiniuImage3:{
		        	id:"qiniuImage3", //图片预览的id   
		        	image_uri:[],    //图片上传的列表  只含有url地址
		        },
		        qiniuImage4:{
		        	id:"qiniuImage4", //图片预览的id   
		        	image_uri:[],    //图片上传的列表  只含有url地址
		        },
		        qiniuImage5:{
		        	id:"qiniuImage5", //图片预览的id   
		        	image_uri:[],    //图片上传的列表  只含有url地址
		        }, 
		        qiniuImage6:{
		        	id:"qiniuImage6", //图片预览的id   
		        	image_uri:[],    //图片上传的列表  只含有url地址
		        }, 
		        qiniuImage7:{
		        	id:"qiniuImage7", //图片预览的id   
		        	image_uri:[],    //图片上传的列表  只含有url地址
		        }, 
		        qiniuImage8:{
		        	id:"qiniuImage8", //图片预览的id   
		        	image_uri:[],    //图片上传的列表  只含有url地址
		        }, 
		        qiniuImage9:{
		        	id:"qiniuImage9", //图片预览的id   
		        	image_uri:[],    //图片上传的列表  只含有url地址
		        }, 
		        qiniuImage10:{
		        	id:"qiniuImage10", //图片预览的id   
		        	image_uri:[],    //图片上传的列表  只含有url地址
		        }, 
		        qiniuImage11:{
		        	id:"qiniuImage11", //图片预览的id   
		        	image_uri:[],    //图片上传的列表  只含有url地址
		        },  
		        packJson:{
					maxLength:6,   //最大图片数量
					accept:"",//image/gif,image/jpeg,image/jpg,image/png如果是这些，可以不传此参数
					size:4    //图片大小  单位兆
				},
				selectSpvUser:{

				} 

			}
		},methods:{
			
			returnBack(){
				this.dialogFormVisible.bool=false;
			},
			submitConfirmForm(formName){
                this.$refs[formName].validate((valid) => { 
		          if (valid) {
		          	if(this.contractValue.length <= 0){
		          		this.$message.warning('请至少选中一个合同模板...');
		          		return;
		          	}
		          	var params = {
		          		contractTemplateList:this.contractValue,
		          		funderId:this.dialogFormInfo.orderInfo.funderId,
		          		spvId:this.dialogFormInfo.orderInfo.spvId,
		          		orderId:this.dialogFormInfo.orderInfo.id 
		          	};
		          	agentHttp.postJson('adminApi/admin/contractinfo/add_contract_list',params ).then((data)=>{
			                if(data.success){
			                  this.dialogFormVisible.bool=false;  
			                  if(data.data.length > 0){
			                  	for (var i = 0; i < data.data.length; i++) {
			                  	 this.$message.warning( data.data[i].message); 
			                  	}
			                  } 
			                  else {
			                  	this.$emit('refreshTableData');
			                  	 this.$message.success( "生成合同成功..."); 
			                  }  
			                } 
			         })
		          	
		           } else {
		            console.log('error submit!!');
		            return false;
		          }
		        });
			},
			handleRemove(file, fileList) {
		        console.log(file, fileList);
		    },
		    handlePictureCardPreview(file) {
		        this.dialogImageUrl = file.url;
		        this.dialogVisible = true;
		    },
		    contractChange(value, direction, movedKeys){//右边的值·····方向字符串······移动的值
		    	//console.log(value+"````````````"+direction+"```````````"+movedKeys)
		    },
		    initDataInfo(){ 
		    	//数据处理
		    	if(this.dialogFormInfo.orderInfo.cashDepositInfo == null ){ 
		    		this.dialogFormInfo.orderInfo.cashDepositInfo ={};
		    	} 
		    	if(this.dialogFormInfo.orderInfo.carInspectionInfo == null ){ 
		    		this.dialogFormInfo.orderInfo.carInspectionInfo ={};
		    	} 
		    	if(this.dialogFormInfo.orderInfo.logisticsCompany == null ){ 
		    		this.dialogFormInfo.orderInfo.logisticsCompany ={};
		    	} 
		    	this.dialogFormInfo.funderUser.push({id:0,realname:"请选择资金方"})
		    	this.getSpvUser(); 
		    	//购销合同
		    	this.bindImage("contracts","qiniuImage1"); 
		    	//定金凭证
		    	this.bindImage("depositPic","qiniuImage2");  
		    	//供应商收款账号
		    	this.bindImage("supplierInfoPic","qiniuImage3");  
		    	//提车地址及联系人
		    	this.bindImage("supplierAddressPic","qiniuImage4"); 
		    	//补充图片
		    	this.bindImage("supplementPic","qiniuImage5");
		    	//供应商资质图片 
		    	this.bindPreliminaryToexamineImage("examineAptitudePic","qiniuImage6"); 
		    	//资源商图片
		    	this.bindPreliminaryToexamineImage("resourceProviderPic","qiniuImage7"); 
		    	//车辆资料相关证明（打款证明）
		    	this.bindPreliminaryToexamineImage("carInformationPic","qiniuImage8");
		    	//验车图片
		    	this.dialogFormInfo.orderInfo.carInspectionInfo.pic?this.qiniuImage9.image_uri= this.dialogFormInfo.orderInfo.carInspectionInfo.pic.split(',').notempty():"";
		    	//保证金凭证 
		    	this.bindCashDepositInfoImag("voucherPic","qiniuImage10");
		    	//
		    	this.bindCashDepositInfoImag("dealerRemittanceImag","qiniuImage11");

		    	//绑定合同模板
		    	this.bindContractTemplate();
  
		    },
		    bindImage(object,imageId){    
		    	eval("this.dialogFormInfo.orderInfo."+object)?eval("this."+imageId).image_uri= eval("this.dialogFormInfo.orderInfo."+object).split(',').notempty():"";
		    },
		    bindPreliminaryToexamineImage(object,imageId){
		    	eval("this.dialogFormInfo.orderInfo.orderAuditResults."+object)?eval("this."+imageId).image_uri= eval("this.dialogFormInfo.orderInfo.orderAuditResults."+object).split(',').notempty():"";
		    },
		    bindCashDepositInfoImag(object,imageId){
		    	eval("this.dialogFormInfo.orderInfo.cashDepositInfo."+object)?eval("this."+imageId).image_uri= eval("this.dialogFormInfo.orderInfo.cashDepositInfo."+object).split(',').notempty():"";
		    },
		    getSpvUser(){ 
					//如果有spv带出spv
		    	for (var i = 0; i < this.dialogFormInfo.funderUser.length; i++) { 
		    		if( this.dialogFormInfo.funderUser[i].id == this.dialogFormInfo.orderInfo.funderId ){  
		    			if(null != this.dialogFormInfo.funderUser[i].spv){
		    				this.selectSpvUser = this.dialogFormInfo.funderUser[i].spv;   
		    				this.dialogFormInfo.orderInfo.spvId = parseInt(this.dialogFormInfo.funderUser[i].spv.id);
		    				break;
		    			}else {
		    				this.dialogFormInfo.orderInfo.spvId=null;
		    				this.selectSpvUser ={};
		    			}
		    		}else{
		    			    this.dialogFormInfo.orderInfo.spvId=null;
		    				this.selectSpvUser ={};
		    		}  
		    	}  
		    	//修改资金方后需要修改合同模板.  
		    	if(this.dialogFormInfo.orderInfo.funderId != null && this.dialogFormInfo.orderInfo.id!=null){
		    			agentHttp.get('adminApi/admin/contractinfo/get_order_contract_info_get_template/'+this.dialogFormInfo.orderInfo.funderId+"/" + this.dialogFormInfo.orderInfo.id ).then((data)=>{  
			                if(data.success){  
			                  this.contractData = [];
			                  this.dialogFormInfo.contractList = data.data;  
			                  this.bindContractTemplate();
			                } 
         		 		}); 
		    	}
		    	
		    	 
			},
			//绑定合同模板
			bindContractTemplate(){
				
				for (var i = 0; i < this.dialogFormInfo.contractList.length; i++) {
		    	 	var contractInfo = this.dialogFormInfo.contractList[i];
		    	 	this.contractData.push({
		    	 		key : contractInfo.id,
		    	 		label : contractInfo.name
		    	 	})
		    	 } 
			}



		  
		}
	};
		/*]]>*/
</script>
